﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Kunlun.Models;
namespace Kunlun.Controllers
{
    public class SelectController : Controller
    {
        //
        // GET: /Select/
        KunLunEntities entitise = new KunLunEntities();
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult SelectArea(int id)
        {
            var area= from a in entitise.Area
                        where a.fatherID == id
                        select a;


            return Json(area,JsonRequestBehavior.AllowGet);
        }
        
        public ActionResult SelectCity(int id)
        {
            var city = from a in entitise.City
                       where a.fatherID == id
                       select a;


            return Json(city,JsonRequestBehavior.AllowGet);
        }

    }
}
